from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action
from core.support import set_cutscene

class restroomladies(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        
        # build list of actions
        self.add_action(turnandrun)
        self.add_action(politelydecline)
        self.add_action(answeraffirmatively)
    
    # return description of room.
    def get_description(self):
        return "You choose to use the Ladies Room because the door is cracked open. Upon entering, you see the mother-of-the-bride adjusting her undergarments in front of the mirror. She turns to you and says, 'They're real, and they're faaaabulous. Want to touch them?' How do you respond?"
    
    # return image of room
    def get_image(self):
        return 'restroom.jpg'


class RestroomLadiesHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return restroomladies

# define actions for this room


class turnandrun(Action):
    def __init__(self):
        Action.__init__(self, "Turn and Run!")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Turn and Run!"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'dancefloor'

    def do_action(self,game,room,request):
        set_cutscene("Turning and running showed your cowardice. The MOB is pissed and you should probably stay away from her the rest of the evening. You lost an interaction point!.")
        game.social+=-1
        self.usable = False
        return

class politelydecline(Action):
    def __init__(self):
        Action.__init__(self, "Politely Decline")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Politely Decline"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'dancefloor'
    
    def do_action(self,game,room,request):
        set_cutscene("Politely declining was a better choice than turning and running. You saved face for yourself and the crazy MOB. By not avoiding interaction (entirely), you gained an interaction point!")
        game.social+=1
        self.usable = False
        return
    
class answeraffirmatively(Action):
    def __init__(self):
        Action.__init__(self, "Answer Affirmatively")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Engage the MoB"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'dancefloor'

    def do_action(self,game,room,request):
        set_cutscene("Appeasing the MoB earned yourself 3 interaction points!")
        game.social+=3
        self.usable = False
        return